package stream;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Stream;

public class MyStream2 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.stream().forEach(s-> System.out.println(s));

        HashMap<String,Integer> map = new HashMap<>();
        map.put("zhangsan",23);
        map.put("lisi",24);
        map.put("wangwu",25);
        map.put("zhaoliu",26);
        map.put("qianqi",27);

        map.keySet().stream().forEach(s-> System.out.println(s));
        map.entrySet().stream().forEach(s-> System.out.println(s));

        int [] arr = {1,2,3,4,5};
        Arrays.stream(arr).forEach(s-> System.out.println(s));

        Stream.of(1,2,3,4,5).forEach(s-> System.out.println(s));
    }
}
